import request from '@/utils/request'

export function getApplicationPage(params) {
    return request({
        url: `/api/v1/core/application/page`,
        method: 'post',
        data: params
    })
}

export function addApplication(params) {
    return request({
        url: `/api/v1/core/application/add`,
        method: 'post',
        data: params
    })
}

export function updateApplication(params) {
    return request({
        url: `/api/v1/core/application/update`,
        method: 'post',
        data: params
    })
}

export function deleteApplication(params) {
    return request({
        url: `/api/v1/core/application/delete?id=${params.id}`,
        method: 'get'
    })
}

export function syncApplicationInterface(params) {
    return request({
        url: `/api/v1/core/application/sync`,
        method: 'post',
        data: params
    })
}

export function getAppList(params) {
    return request({
        url: `/api/v1/core/application/list`,
        method: 'post',
        data: params
    })
}

export function getAppModuleList(params) {
    return request({
        url: `/api/v1/core/application/module/list?appId=${params.appId}`,
        method: 'get'
    })
}

export function getAppInterfaceList(params) {
    return request({
        url: `/api/v1/core/application/interface/page`,
        method: 'post',
        data: params
    })
}
